package com.xsmart.goods.api;

import com.xsmart.common.entity.RequestBean;
import com.xsmart.common.entity.ResponseBean;
import com.xsmart.goods.services.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/api")
public class BrandController {
    @Autowired
    BrandService brandService;

    @RequestMapping(value = "/v1/BrandService/queryBrand", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean queryBrand(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return brandService.queryBrand(requestBean);
    }
    @RequestMapping(value = "/v1/BrandService/addBrand", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean addBrand(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return brandService.addBrand(requestBean);
    }
    @RequestMapping(value = "/v1/BrandService/modBrand", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean modBrand(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return brandService.modBrand(requestBean);
    }
    @RequestMapping(value = "/v1/BrandService/delBrand", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean delBrand(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return brandService.delBrand(requestBean);
    }
    @RequestMapping(value = "/v1/BrandService/queryAllBrand", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean queryAllBrand(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return brandService.queryAllBrand(requestBean);
    }
}
